#include "../mqcommon/helper.hpp"

int main()
{
    /* lrlmq::FileHelper helper("../mqcommon/logger.hpp");
    DLOG("是否存在：%d", helper.exists());
    DLOG("文件大小：%ld", helper.size());

    lrlmq::FileHelper tmp_helper("./aaa/bbb/ccc/tmp.hpp");
    if (tmp_helper.exists() == false) {
        std::string path = lrlmq::FileHelper::parentDirectory("./aaa/bbb/ccc/tmp.hpp");
        if (lrlmq::FileHelper(path).exists() == false) {
            lrlmq::FileHelper::createDirectory(path);
        }
        lrlmq::FileHelper::createFile("./aaa/bbb/ccc/tmp.hpp");
    }

    std::string body;
    helper.read(body);
    tmp_helper.write(body); */
    lrlmq::FileHelper tmp_helper("./aaa/bbb/ccc/tmp.hpp");
    char str[16] = {0};
    tmp_helper.read(str, 8, 11);
    DLOG("[%s]", str);
    tmp_helper.write("12345678901", 8, 11);
    tmp_helper.rename("./aaa/bbb/ccc/test.hpp");

    lrlmq::FileHelper::removeFile("./aaa/bbb/ccc/test.hpp");
    lrlmq::FileHelper::removeDirectory("./aaa");
    return 0;
}